<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const input = [
            'zhangsan:zhangsan@163.com',
            'lisi:ls@qq.com',
            'wangwu:wang5@outlook.com',
            'liuliu:liu6@gmail.com',
        ];

        const output = [
            {
                name: 'zhangsan',
                email: 'zhangsan@163.com',
            },
            {
                name: 'lisi',
                email: 'ls@qq.com',
            },
            {
                name: 'wangwu',
                email: 'wang5@outlook.com',
            },
            {
                name: 'liuliu',
                email: 'liu6@gmail.com',
            },
        ];

        // ⭐
        function transform (input) {
            return input.map((item) => {
                const [name, email] = item.split(':');
                return {
                    name,
                    email,
                };
            });
        }
        console.log(transform(input));
    </script>
</body>
</html>